import Taro from "@tarojs/taro";

/**
 * 检查新版本
 */
export const checkNewVersion = () => {
  let manager = Taro.getUpdateManager();
  manager.onCheckForUpdate(() => {
  });
  manager.onUpdateReady(() => {
    Taro.showModal({
      title: "更新提示",
      content: "新版本已经准备好，需要重启应用",
      showCancel: false,
      success: res => {
        if (res.confirm) {
          manager.applyUpdate();
        }
      }
    });
  });
};
